#include <iostream>
#include <cstring>
#include <algorithm>
#define int long long 

using namespace std;

bool check(int x)
{
    int cnt = 1;
    while (x)
    {
        int r = x % 10;
        if (r % 2 != cnt % 2) return false;
        x /= 10, cnt ++ ;
    }
    return true;
}

void solve()
{
    int n;
    cin >> n;

    int res = 0;
    for (int i = 1; i <= n; i ++ )
        if (check(i))
            res ++ ;

    cout << res << endl;
}

signed main()
{
    ios::sync_with_stdio(false);
    cin.tie(nullptr),cout.tie(nullptr);
    int t = 1;
    while(t -- )  solve();
    return 0;
}

